<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>基本资料</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
		<link rel="stylesheet" href="../css/public.css" media="all">
		<style>
			.layui-form-item .layui-input-company {
				width: auto;
				padding-right: 10px;
				line-height: 38px;
			}
		</style>
	</head>
	<body>
		<script>
			var _json =
				'{"did_1647072425313_0":{"id":"uploadImage","name":"head","required":"1","disabled":"","labelWidth":80,"rowWidth":100,"validateRule":[],"label":"头像选择","maxSize":"5120","uploadUrl":"","divId":"did_1647072425313_0"},"did_1647072425315_1":{"id":"select","name":"school","required":"","disabled":"","labelWidth":80,"rowWidth":100,"dataType":"","options":[{"value":"sspu","text":"sspu","isSelect":"0"},{"value":"北京大学","text":"北京大学","isSelect":"1"},{"value":"清华大学","text":"清华大学","isSelect":"1"}],"label":"学校","divId":"did_1647072425315_1"},"did_1647072425316_2":{"id":"password","name":"pws","required":"1","disabled":"","labelWidth":80,"rowWidth":100,"inputWidth":60,"validateRule":["a_z0_9"],"label":"旧密码","divId":"did_1647072425316_2"},"did_1647072425318_3":{"id":"text","name":"npws","required":"1","disabled":"","labelWidth":80,"rowWidth":100,"inputWidth":60,"validateRule":["a_z0_9"],"label":"新密码","divId":"did_1647072425318_3"},"did_1647072425319_4":{"id":"submitData","name":"name1647072411042","divId":"did_1647072425319_4"}}';
		</script>
		<form enctype="multipart/form-data" action="/CampusForum/updateUser" class="layui-form" id="form"
			lay-filter="form">
			<div class="layui-form-item adminj-sort-item" id="did_1647072425313_0" cpt_id="uploadImage"
				style="width: 100%;">
				<label class="layui-form-label">头像选择</label>
				<div class="layui-input-inline">
					<div class="layui-upload">
						<!--            <button type="button" class="layui-btn" id="test1">选择封面</button>-->
						<i class=" layui-icon layui-icon-upload-circle" id="test1"
							style="font-size: 30px; color: #1E9FFF;"></i>
					</div>
					<div class="layui-form-mid layui-word-aux"></div>


				</div>
				<div class="layui-form-item adminj-sort-item" id="did_1647072425315_1" cpt_id="select"
					style="width: 100%;">
					<label class="layui-form-label">学校</label>
					<div class="layui-input-inline">
						<select name="school">
							<option value="sspu" selected="">sspu</option>
							<option value="北京大学">北京大学</option>
							<option value="清华大学">清华大学</option>
						</select>
					</div>
					<div class="layui-form-mid layui-word-aux"></div>

				</div>
				<div class="layui-form-item adminj-sort-item" id="did_1647072425316_2" cpt_id="password"
					style="width: 100%;">
					<label class="layui-form-label">旧密码</label>
					<div class="layui-input-inline" style="width:60%;">
						<input type="password" name="pws" autocomplete="off" class="layui-input" style="width: 99%;"
							lay-verify="a_z0_9">
					</div>
					<div class="layui-form-mid layui-word-aux"></div>

				</div>
				<div class="layui-form-item adminj-sort-item" id="did_1647072425318_3" cpt_id="text"
					style="width: 100%;">
					<label class="layui-form-label">新密码</label>
					<div class="layui-input-inline" style="width:60%;">
						<input type="text" name="npws" autocomplete="off" class="layui-input" style="width: 99%;"
							lay-verify="a_z0_9">
					</div>
					<div class="layui-form-mid layui-word-aux"></div>
				</div>
				<div id="did_1647072425319_4" class="layui-form-item adminj-sort-item" cpt_id="submitData">
					<div class="layui-input-block">
						<button type="submit" class="layui-btn" lay-submit="" lay-filter="postButton"
							id="postButton">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>

				</div>
			</div>
		</form>

	</body>
</html>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>

<script>
	layui.use(['upload', 'jquery'], function() {
		var $ = layui.jquery,
			upload = layui.upload;
		//普通图片上传
		var uploadInst = upload.render({
			elem: '#test1'
				// ,url: '/CampusForum/upload'
				,
			auto: false,
			bindAction: "#btn",
			accept: 'images',
			exts: 'jpg|png',
			multiple: false,
			size: 3072,
			before: function(obj) {
				//预读本地文件示例，不支持ie8
				obj.preview(function(index, file, result) {
					$('#demo1').attr('src', result); //图片链接（base64）
				});
			},
			done: function(res) {
				//如果上传失败
				if (res.state > 0) {
					layer.msg('上传失败');
				}
				//上传成功
				layer.msg('上传成功');
			}
		});
	});
</script>
